from flask import Blueprint
from . import view

app_blueprint = Blueprint('app_blueprint', __name__)

# 添加app
app_blueprint.add_url_rule(rule='/add', methods=['POST'], view_func=view.addApp)

# 删除app
app_blueprint.add_url_rule(rule='/delete', methods=['delete'], view_func=view.deleteApp)

# 更新app[当前用户(创建者)或者管理员(all)]
app_blueprint.add_url_rule(rule='/update', methods=['PUT'], view_func=view.updateApp)

# 获取app[按appId从当前用户的app集中获取或管理员(all)]
app_blueprint.add_url_rule(rule='/get', methods=['POST'], view_func=view.getApp)

# 分页并按条件查询用户的app集[当前用户或者管理员(all)]
app_blueprint.add_url_rule(rule='/list', methods=['POST'], view_func=view.listAppByPage)
app_blueprint.add_url_rule(rule='/list/my', methods=['POST'], view_func=view.listMyAppByPage)

# 审核用户创建的app[仅管理员权限]
app_blueprint.add_url_rule(rule='/review', methods=['POST'], view_func=view.reviewApp)
